import Vue from "vue";
import App from "./App.vue";
import "./registerServiceWorker";
import router from "./router";
import store from "./store";
import "./assets/font/iconfont.css" // 全局导入
import "./assets/css/common.css" // 公共样式
import "./assets/js/vant_components.js" // vant组件
import {clientHeight} from "./assets/js/common.js"
import "lib-flexible"; // 导入lib-flexible模块 内置媒体查询  可以在不同的移动端屏幕下 根标签文字尺寸的动态计算
// 导入axios网络请求模块和vue-axios模块
import axios from 'axios';
import VueAxios from "vue-axios";
import VueRouter from "vue-router";
// Swiper轮播如的导入
import vueAwesomeSwiper from "vue-awesome-swiper";
import "swiper/dist/css/swiper.css";

Vue.config.productionTip = false;
Vue.prototype.$height = clientHeight;
// 对axios进行全局注册 注意axios必须发生在根Vue实例被创建之前,并且注册成功之后axios会对
// 所有vue实例的属性进行调用
Vue.use(VueAxios,axios);
// 对轮播图全局注册
Vue.use(vueAwesomeSwiper);

//该操作用来设置根Vue实例，该实例被挂载到public对应的index.html中的#app的div标签 
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");

const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location) {
  return originalReplace.call(this, location).catch(err => err);
};
